package net.techwatch.gwt.mvp.client.view;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.inject.Inject;

public class MessageDisplayerImpl implements MessageDisplayer {

	private Display display;
	
	@Inject
	public MessageDisplayerImpl(Display display) {
		this.display = display;
		
		this.display.getCloseButton().addClickHandler(new ClickHandler() {
		
			@Override
			public void onClick(ClickEvent event) {
				((DialogBox) MessageDisplayerImpl.this.display.getWidget()).hide();
			}
		});
	}

	@Override
	public Display getView() {
		return display;
	}
	
}
